<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/core/common/top.jsp" %>
<script language="javascript">
 <!--  
   
   function doEdit(id){
      location.href="${ctx}/contentManage/metadataOpt.action?act=editInput&metadata.contid="+id+"&pageState=edit";
   }
   
   function doView(id){
      location.href="${ctx}/contentManage/metadataOpt.action?act=view&metadata.contid="+id;
   }   
   
   function doDelete(id){
      if (confirm('<s:text name="asset.delete.confirm" />'))
      	location.href="${ctx}/contentManage/metadataOpt.action?act=delete&metadata.contid="+id;
   }
   
   function sort(fieldName){
   		if(document.searchForm.sortField.value!=fieldName){
   			document.searchForm.sortMode.value="asc";
   		}else{
   			if('asc'=='<s:property value="sortMode"/>')
   				document.searchForm.sortMode.value="desc";
   			if('desc'=='<s:property value="sortMode"/>')
   				document.searchForm.sortMode.value="asc";
   		}
   		document.searchForm.sortField.value=fieldName;
   		document.searchForm.submit();
   }
   
   function viewCaption(id){
      window.open("contentCaption.action?act=captionView&contentId="+id,"captionView");
   }  
//-->    
</script>
<body style="overflow-x:hidden;overflow-y:auto;">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<%@include file="/WEB-INF/core/common/message.jsp"  %>
  <tr><td><table border="0" align="center" cellpadding="0" cellspacing="0">
    <td width="8" height="27"><img src="${ctx}/core/images/button_05.gif" width="8" height="27" /></td>
    <td width="99%" align="left" background="${ctx}/core/images/button_06.gif" class="bluecu">&nbsp;<img src="${ctx}/core/images/icon_04.gif" />&nbsp;<s:text name="metadata.management"/></td>
    <td width="8"><img src="${ctx}/core/images/button_07.gif" width="8" height="27" /></td>
    </table>
    </td>
  </tr>
  
  <tr>
    <td class="biaoge">	
     
	     <table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <form name="searchForm" method="post"  action="${ctx}/contentManage/contentMetadate.action">
	      		    <input type="hidden" name="act" value="query"/>
					<input type="hidden" name="sortField" value='<s:property value="sortField"/>'/>
					<input type="hidden" name="sortMode" value='<s:property value="sortMode"/>'/>	     
	<tr>
        <td height="10"></td>
      </tr>  
	  <tr>
		<!-- 查询条件 -->
	    <td class="tabulation"><div style="position:relative">
	      <div id="menu1"><img src="${ctx}/core/images/icon_13.gif"><s:text name="info.queryCondition" /></div>

	        <table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
			        <tr align="left">
			        	<td  bgcolor="#DDE4EA" nowrap="nowrap">&nbsp;&nbsp;<s:text name="metadata.contid" /></td>
				        <td  bgcolor="#DDE4EA">
				            <exts:textfield id="q_contID" name="q_contID" value="%{q_contID}" class="textbox_css" style="width:150px"/>
				        </td>	
				        <td  bgcolor="#DDE4EA" nowrap="nowrap">&nbsp;&nbsp;<s:text name="metadata.title" /></td>
				        <td  bgcolor="#DDE4EA">
				            <exts:textfield id="q_title" name="q_title" value="%{q_title}" class="textbox_css" style="width:150px"/>
				        </td>
                      <td  bgcolor="#DDE4EA" >&nbsp;&nbsp;<s:text name="metadata.genre"/>&nbsp;</td>
                      <td  bgcolor="#DDE4EA" >
					  		<select name="q_genre">
					  			<option value=""></option>
					  			<s:iterator value="contentTypeList" id="genre">
					  				<option value="<s:property value='#genre[1]'/>"><s:text name="%{#attr.genre[1]}"/></option>
					  			</s:iterator>
					  		</select>
					  		<script>document.getElementById("q_genre").value="<s:property value='q_genre'/>";</script>
					  </td>
				    </tr> 
				    <tr align="left">
				        <td bgcolor="#DDE4EA" nowrap="nowrap">&nbsp;&nbsp;<s:text name="metadata.status" /></td>
				        <td bgcolor="#DDE4EA">
				            <select name="q_status">
				            	<option value=""></option>
				            	<option value="1">InService</option>
				            	<option value="0">OutOfService</option>
				            	<option value="-1">Destroy</option>
				            </select>
				            <script>searchForm.q_status.value='<s:property value="q_status"/>'</script>
				        </td>
				        <td bgcolor="#DDE4EA" nowrap="nowrap">&nbsp;&nbsp;<s:text name="asset.manage.status" /></td>
				        <td bgcolor="#DDE4EA" colspan=3>
				            <select name="q_manageStatus">
				            	<option value=""></option>
				            	<option value="1"><s:text name="label.valid" /></option>
				            	<option value="0"><s:text name="delete.ready" /></option>
				            	<option value="-2"><s:text name="deleting" /></option>
				            	<option value="-1"><s:text name="delete.failed" /></option>
				            	<option value="-3"><s:text name="delete.again" /></option>
				            </select>
				            <script>searchForm.q_manageStatus.value='<s:property value="q_manageStatus"/>'</script>
				        </td>
				    </tr> 
    		        <tr>
			        	<td height="20" colspan="6" align="right" bgcolor="#DDE4EA">
						   <input type="submit" class="btn" name="quary" value="<s:text name='button.query' />" />
				        </td>
			        </tr>		       
		       
			</table> </div></td>
	<!-- 查询条件结束 -->

  </tr>
  <tr>
    <td height="5"></td>
  </tr>
  <tr>
    <td height="10" background="${ctx}/core/images/line5.gif"></td>
    </tr>
  <tr>
    <td height="5"></td>
  </tr>
   </form>
</table>
        <!--查询-->
      <table id="content" width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#A6A6A6">
        <tr bgcolor="#C7D6EA">
          <td width="5%" height="20" align="center" class="table_head"><s:text name="info.No" /></td>
          <td width="15%" align="center" class="table_head"><s:text name="metadata.contid" /></td>
          <td width="15%" align="center" class="table_head" ><a href="javascript:sort('TITLE')"><s:text name="metadata.title" /></a><s:if test="sortField=='TITLE'"><s:if test="sortMode=='asc'"><font color="red">↑</font></s:if><s:else><font color="red">↓</font></s:else></s:if></td>
          <td width="15%" align="center" class="table_head"><s:text name="metadata.genre" /></td>
          <td width="10%" align="center" class="table_head"><s:text name="metadata.provider" /></td>
          <td width="15%" align="center" class="table_head"><a href="javascript:sort('CREATION_DATE')"><s:text name="task.creation.time" /></a><s:if test="sortField=='CREATION_DATE'"><s:if test="sortMode=='asc'"><font color="red">↑</font></s:if><s:else><font color="red">↓</font></s:else></s:if></td>
          <td width="10%" align="center" class="table_head"><s:text name="metadata.status" /></td>
          <td width="7%" align="center" class="table_head"><s:text name="asset.manage.status" /></td>
          <td width="8%" align="center" class="table_head"><s:text name="info.operate" /></td>
        </tr>
 		<s:iterator value="pageInfo.searchResult" id="it" status="st">
	        <tr>
	          <td height="20" align="center"><s:property value="%{(pageInfo.currentPageNo-1)*pageInfo.pageSize+#st.index+1}" /></td>
	          <td align="center"><exts:property value="0"/></td>
	          <td align="center" style="word-wrap:break-word;word-break:break-all;"><exts:property value="1"/></td>
	          <td align="center" style="word-wrap:break-word;word-break:break-all;"><exts:property value="2"/></td>
	          <td align="center"><exts:property value="3"/></td>
	          <td align="center"><exts:property value="4"/></td>
	          <td align="center"><s:if test="#it[5]==0">OutOfService</s:if><s:elseif test="#it[5]==1">InService</s:elseif><s:else>Destroy</s:else></td>
	          <td align="center"><s:if test="#it[6]==0"><s:text name="delete.ready" /></s:if><s:if test="#it[6]==1"><s:text name="label.valid" /></s:if><s:if test="#it[6]==-1"><s:text name="delete.failed" /></s:if><s:if test="#it[6]==-2"><s:text name="deleting" /></s:if><s:if test="#it[6]==-3"><s:text name="delete.again" /></s:if></td>
	          <td align="center">
	          	<table height="20" border="0" cellpadding="0" cellspacing="0">
	                <tr>
		                <s:if test="#it[5]!=-1">
		                	<td width="22" align="right"><a href="javascript:doEdit('<exts:property value='0'/>')"><img src="${ctx}/core/images/edit.gif" name="icon_064"  border="0" id="icon_064" style="CURSOR: hand" title="<s:text name='button.edit' />"/></a></td>
	               		</s:if>
	               		<s:elseif test="#it[6]==-1">
	               			<td width="22" align="right"><a href="javascript:doView('<exts:property value='0'/>')"><img src="${ctx}/core/images/view.gif" name="icon_074"  border="0" id="icon_074" style="CURSOR: hand" title="<s:text name='button.view' />"/></a></td>
	               		</s:elseif>
	               		<s:else>
	               		<td width="22" align="right"><a href="javascript:doView('<exts:property value='0'/>')"><img src="${ctx}/core/images/view.gif" name="icon_074"  border="0" id="icon_074" style="CURSOR: hand" title="<s:text name='button.view' />"/></a></td>	
	               		</s:else>
	               		<!-- 只有资产删除失败时，才提供删除功能 -->
	               		<s:if test="#it[5]==-1&&#it[6]==-1">
	               			<td width="22" align="right"><a href="javascript:doDelete('<exts:property value='0'/>')"><img src="${ctx}/core/images/del.gif" name="icon_074"  border="0" id="icon_074" style="CURSOR: hand" title="<s:text name='button.delete' />"/></a></td>
	               		</s:if>
	                </tr>
	          	</table>
	          </td>
	        </tr>
	    </s:iterator>
	   
      </table>
      
      <!-- 分页 -->	  
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr><td>${pagination}</td></tr>
          </table>
          
      <!-- 分页结束 -->	
    </td></tr></table>
</body>

<script>
	tables('content',null);
</script>